This is the back end for a group project built that was built in 5 days during week 12 of the Develop Me Coding Fellowship. Nerd Words is a dictionary app aimed at beginners to coding, which included the ability for users to create a list of 'liked' words. I was responsible for setting up the database and API using Laravel whilst my two coursemates were responsible for building the front end using React and Redux (repo for their work available here and live site available here). I set the API up on a server using AWS, which is available at the following URL: https://nerdwords.developme.space/api/
To get set up with the project on your local machine you will need Vagrant downloaded on your machine. Once you've done this, follow these instructions:
- Run
git clone [email protected]:LaikaTheSpaceDog/final-project-back-end.git <desired sub-directory>
. The project files will be cloned to your local repo. - Go to your project directory and run
npm install
. This will install the dependencies in the local node_modules folder. - Go to the project folder:
cd final-project-back-end
. - Run
composer install
to download the required dependencies locally. - Run
vendor/bin/homestead make
to copy relevant Homestead files into project directory. - Change the second line of Homestead.yaml so it just uses 512mb:
memory: 512
- Run
cp .env.example .env
to create a .env file - In your newly created .env file, make the following changes:
DB_DATABASE=homestead
DB_USERNAME=root
DB_PASSWORD=secret
- Run
vagrant up
to get Vagrant up and running. - Once Vagrant has finished loading, in your browser go to the below to view the UI:
- On Mac: http:https://homestead.test
- On Windows: http:https://localhost:8000
- Run
vagrant ssh
to SSH into the running Vagrant machine. - Run
cd code
to enter the code directory. - Run
artisan migrate
to run all migrations. - optional: Run
artisan db:seed
to run the Owners seeder - this will populate the Words table with the words we used in our live site.
Please see below for a list of the API routes that you can use once you have the project set up in your local environment.
- GET: http:https://homestead.test/api/words
- GET: http:https://homestead.test/api/words/{id}
- GET: http:https://homestead.test/api/words/{id}/links
- GET: http:https://homestead.test/api/words/liked
- POST: http:https://homestead.test/api/words
- POST: http:https://homestead.test/api/words/{id}/links
- PUT: http:https://homestead.test/api/words/{id}
- PATCH: http:https://homestead.test/api/words/{id}