This is an assignment task provided by Atlys. For Backend I have used Nodejs , ExpressJs , Javascript and MongoDB.Follow the guide below to install the application to your desktop and run it locally. API Documentation
- Auth (Sign in/Sign up)
- Create Post ( Anonymously or as User)
- Get all Posts
- Delete Post
- Forgot Password
- Reset Password
- Update Current user password
- Get Current user
- Delete current user
First please clone this repository
git clone https://github.com/Aakash-Rana/Atlys-Backend.git
First update .env file to server folder Update these variables down below to .env file and set them as you want.
DATABASE_PASSWORD = xxxx
EMAIL_USERNAME = xxxx
EMAIL_PASSWORD = xxxx
To setup email functionality which we are using for forgot and resetting password. I have used Mailtrap.io , you can use any Email Delivery platform. After setting up you will get below details that you need to update in config.env
EMAIL_USERNAME=
EMAIL_PASSWORD=
EMAIL_HOST=smtp.mailtrap.io
EMAIL_PORT=25
If you don't have mongoDB installed on your local machine then create a MongoDB Atlas cluster and add the link to your .env file.
Also update server.js
file code
in server.js , update DATABASE_LOCAL to DATABASE
const DB = process.env.DATABASE_LOCAL.replace(
'<PASSWORD>',
process.env.DATABASE_PASSWORD
);
in config.env
DATABASE = ??? if you don't have mongodb installed.
Go server folder and install the requirements and start the server.
npm install
npm start (for production)
npm run start:dev ( for development)
App is ready to go. Check the localhost with the port ( default=3000 ) that you set for PORT in .env file. http://localhost:3000