zj05409 / restaurants-reservation-api Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
First, you can cd into the docker/ directory of the api project, and execute the command:
docker-compose -f docker-compose.dev.yml up
after finished, you will see:
Second, you cd into the root of the frontend project and run:
yarn && mkdir -p ../restaurants-reservation-api/public && yarn build && cp -r build/* ../restaurants-reservation-api/public
Then you have build and copy the frontend app into the backend app.
After that, you can open http://localhost:5000 in your Chrome, and see this:
Now you can input 'admin' as your username, 'hilton' as your password, click the 'Login' button, then you will login as a 'Admin' user, who is a builtin user who can only create a 'Employee' user, and nothing else. After login success, you'll see this:
In this page, you can input the infomation and create a 'Employee' user, who can list reservations from all 'Guest' users, and update them.
After you submit, the page will become empty again, and you can create another 'Employee' user.
Now you can click 'Logout' button, and go back to the login page.
Then you can click the 'Register now' link, and go to the 'Guest' user register page.
After you complete the information and submit, you'll goto the login page automaticly.
Then you can login as the 'Guest' user you just created.
in this page, i.e. the 'Reservations' page, you can add a reservation by clicking the 'Add' button and fill the form.
After submitting, you'll go back to the 'Reservations' page, and now you need to refresh the page, and see the newest reservation list:
You hit the 'Edit' button, then you can update the information and hit the 'Update' button to submit.
After you submit, you go back to the 'Reservations' page again.
Now you can logout and login as a employee that you created as a 'Admin' user in the first step.
In the page you see after login, you can not see the 'Add' button anymore. But you can see all the reservations in the app. (The Guest users can only see their own reservations.), and update them.
You can also change the reservation status from the default value 'Pending' into 'Completed' or 'Canceled'.(The 'Guest' users can only change theire own reservations from 'Pending' into 'Canceled'). But by now I only finished developing the Rest and GraphQL apis of the 'Change Status' function, not the frontend.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.