Anime.io is a social networking website where you can make friends and communicate with them.
- π¦Ύ Uses Express as the application Framework.
- π£ Real-time communication between client and server using Socket.io.
- π₯ Real-time Private Communication.
- π¨βπ¨βπ§βπ¦ Real-time Group Communication.
- β± Real-time Notification.
- π Uses MongoDB, Mongoose and MongoDB Atlas for storing and querying data.
- π Can Search people and follow them.
- π° Uses ejs(Embedded JavaScript) as templating language view engine.
- π JWT is used for Authentication.
- π Passwords are hashed using bcrypt-nodejs package.
- βοΈ Uses dotenv to Load environment variables from .env file.
- Nodejs : JavaScript runtime environment that executes JavaScript code outside a web browser.
- Express : Uses Express as the application Framework.
- Socket.io : Real-time communication between a client and a server using Socket.io.
- MongoDB : MongoDB is a cross-platform document-oriented database program. Classified as a NoSQL database program.
- JWT : JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be verified and trusted because it is digitally signed
- Html & CSS : Html and CSS is used for frontend design.
- Clone or Download the repository
$ git clone
$ cd Anime.io
- Install Dependencies
$ npm install
- Create Config file(./config.env) and fill all environment variables.
NODE_ENV=development // Node environment production/development
PORT=8000 // Port to run server
USER=L-lawliet07 // Username
DB_USERNAME=lawliet07 // mongo atlas username
DB_PASSWORD=<Password> // mongo atlas password
DB=<CONNECTION STRING> // mongo atlas connection string
DB_LOCAL=<LOCAL CONNECTION STRING> // local connection string
JWT_SECRET=this-is-32-character-long-secret
JWT_EXPIRES_IN=90d // JWT valid duration
JWT_COOKIE_EXPIRES_IN=90
EMAIL_USERNAME=<USERNAME>
EMAIL_PASSWORD=<PASSWORD>
EMAIL_HOST=<HOST>
EMAIL_PORT=<PORT>
- Run Parcel to bundle multiple javascript files to single file.
$ npm run watch:js
$ npm run bundle:js
- Start the application
$ npm start
Your app should now be running on localhost:8000
Make sure you have heroku installed on your machine and have heroku account.
- Login to heroku on your machine.
$ heroku login
- Now create a new app.
$ heroku create
- Now push your code to heroku.
$ git push heroku master
-
Set environment variable on heroku.
- Using Command line.
$ heroku config:set <NAME>=<VALUE>
-
Using Heroku Website
- Go to Settings -> Reveal Config Vars.
- Now add Environment variable.
-
Now run
$ heroku open
Make sure you have node and npm installed on your machine.
- Install all the dependenceis using npm install command.
- Now Go to ./config.env and fill.
NODE_ENV=development // Node environment production/development
PORT=8000 // Port to run server
USER=<USERNAME> // Username
Running Locally
Make sure you have mongodb installed on your machine.
- Run Mongo deamon on your computer.
$ mongod
$ mongod --port <PORT>
- Now Go to ./config.env and fill.
DB_LOCAL=mongodb://localhost:<PORT>/animeio
Using MongoDB Atlas
Make sure you have a mongodb account.
- login to mongodb.com.
- Go to new project and enter project name.
- Click build cluster.
- Now goto connect and click allow access from anywhere.
- Now choose connection method(connect your application).
- Copy the connection string and fill config.env.
DB_USERNAME=<Username> // mongo atlas username
DB_PASSWORD=<Password> // mongo atlas password
DB=<Connection String> // mongo atlas connection string
Go to ./config.env and fill.
JWT_SECRET=this-is-32-character-long-secret // jwt secret to sign token
JWT_EXPIRES_IN=90d // jwt token valid duration (90days)
JWT_COOKIE_EXPIRES_IN=90 // jwt cookie valid duration (90days)
-
To send email we have used Nodemailer. Nodemailer is a module for Node.js applications to allow easy as cake email sending.
-
We have also used Mailtrap for fake smtp server for testing(You can user gmail services).
Make sure you have mailtrap account.
- Login to mailtrap.io.
- Go to new project and enter inbox name.
- Then goto smtp setting copy the credentials and paste it to ./config.env.
EMAIL_USERNAME=<USERNAME> EMAIL_PASSWORD=<PASSWORD> EMAIL_HOST= <HOST> EMAIL_PORT=<PORT>
If you find it useful, please give it a starβοΈ and fork itπ€.
< C'mon Fork it βπΌ />