Giter VIP home page Giter VIP logo

simple-login's Introduction

Simple Register

Live Demo ๐Ÿ”ฅ:

Note: be patient if it slow, because I'm using free tier Heroku.

There two di app that need to be run, services and client.

Service โš™๏ธ

Pre Run

This service use Postgres as its DB so install it first on your machine if you don't have. Also install sequelize-cli by running this command.

npm i -g sequelize-cli

This will add sequelize-cli in global.

Install All dependencies

go to server directory and install all its dependecies

cd server
npm install

Create Database

Make sure your database ready. If you don't have database yet, create one. You can change service configuration for database in server/config/config.json. By default the configuration for development will look like this. Change the value if you need it.

{
	"development": {
    "username": "postgres",
    "password": "postgres",
    "database": "database_development",
    "host": "localhost",
    "dialect": "postgres"
  },
}

Migrate

After your database is running, migrate the table by running this command. (make sure you are still in server directory).

npx sequelize-cli db:migrate

That commnand will create the table needed for you.

Run

Run the server by using start command

npm run start

By default it will run at http://localhost:3000.

API

Current User related
Auth

Client ๐Ÿ–ฅ

Pre Run

Go to client directory and create env file

cd client
touch .env.development.local

That command will create env file for you. Open it and add

REACT_APP_SERVER_API=<your-server-host>

You can change <your-server-host>, for example if you previously run server at http://localhost:3000, you can add this in env file

REACT_APP_SERVER_API=http://localhost:3000

Install All dependencies

go to server directory and install all its dependecies (we assume you still in client directory )

npm install

Run

Run the client by using start command

npm run start

By default it will run at http://localhost:3000.

NOTE: if you previously run server first, it it will asked you if you want to run with other port (let's assume that server will take port 3000 so it will suggest you to take port 3001 for client to run).

Test

To test the client, you can use

npm run test

or if you want to see the coverage, you can use

npm run test -- --coverage
Test Coverage

coverage

Tech Use

Server

  • Express
  • Postgress
  • Sequelize
  • Express-Validator

Client

  • React
  • Ant-Design
  • Axios
  • @testing-library

simple-login's People

Contributors

restaadiputra avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.