Skip to content

Latest commit

 

History

History
239 lines (192 loc) · 8.25 KB

README.md

File metadata and controls

239 lines (192 loc) · 8.25 KB

Contributors Forks Issues

u10-business-idea-snusmumriken-barn

Table of Contents

  1. About The Project
  2. Setting up the application
  3. Page and Route Descriptions
  4. Developers
  5. Contributing
  6. Future Development Ideas
  7. License
  8. Contact
  9. Acknowledgements

About The Project

The idea came from the many enthusiastic forums about wine, beer, cigars, weed, etc. and we felt the need for a forum about the brown gold was much needed. Here you get all snus-enthusiasts around the world in the same forum where they can share snus recipes, discuss their favourite snuses in our forum posts and much more!

Figma Sketch

figma.com

Built With

This application was built with:

Code Standards

Database Sketch

draw.io

API Sample

Economic Calculation

Budget

Deployed Website

Setting up the application

Getting started with frontend React

  • Clone this repo
https://github.com/chas-academy/u10-business-idea-snusmumriken-barn.git
  • cd into the frontend folder
npm install

Deploy to surge

If you have access to deploy frontend to surge, accept the invite first and then follow these instructions:

  • cd into the frontend folder
npm install --global surge
npm run-script build && cd build && cp index.html 200.html && surge --domain snusare.surge.sh .

Next time you will deploy to surge:

  • cd into the frontend folder
npm run-script deploy

The page is deployed to snusare.surge.sh

Getting started with backend Laravel

  • If not already done; clone this repo
  • cd into the backend folder
    docker run --rm \
        -u “$(id -u):$(id -g)” \
        -v $(pwd):/opt \
        -w /opt \
        laravelsail/php80-composer:latest \
        composer install --ignore-platform-reqs
  • Rename ".env-example" to ".env"
  • Generate base key
.vendor/bin/sail up

or:

.vendor/bin/sail artisan key:generate
  • Open the application at localhost:80
  • If Laravel gives error that you are missing a key, click the generate button

Setting up database connection

./vendor/bin/sail exec mysql bash
mysql
show databases;
CREATE USER 'sail'@'172.**.0.7' IDENTIFIED BY 'password';
GRANT ALL ON *.* TO 'sail'@'172.**.0.7';
FLUSH PRIVILEGES;

Install jwt in backend folder

./vendor/bin/sail composer require tymon/jwt-auth --ignore-platform-reqs
./vendor/bin/sail artisan jwt:secret

Page and Route Descriptions

Command Description
/snuses ger alla snuser och dess snittbetyg. benämnt snuses
/snuses/{id} ger alla data om en snus baserat på id. benämnt snus
/reviews ger alla reviews. benämnt reviews
/reviews/{id} ger all data om en review baserat på id. benämnt review
/store-review sparar en review, vill ha följande data -snuses_id -body -rating (går även att lägga till title om så önskas)
/delete-comments/{id} tar bort en comment baserat på dess id
/store-comments sparar en comment, vill ha följande data
/comments/{id} ger all data om en comment. benämnt comment
/comments ger alla comments. benämnt comments
/flavours/{id} ger all data om en flavour. benämnt flavour
/flavours ger alla flavours. benämnt flavours
/categorys/{id} ger all data om en category. benämnt category
/categorys ger alla categorys. benämnt categorys
/delete-posts/{id} tar bort en post baserat på dess id
/store-posts sparar en post, vill ha följande data
/posts/{id} ger all data om en post baserat på id. benämnt post
/posts ger alla posts. benämnt posts
/delete-review/{id} tar bort en specifik review baserat på dess id
/favourites returns a list of all favourites available
/favourites/{userID} returns a list of specified users favourites
/store-favourites saves a flavour to logged in users favourites req: flavourID
/delete-favourites/{id} tar bort en favorite baserat på dess id
/user-profile Ger all data om den inloggade usern. benämnt user

Contributing

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Future Development Ideas

  • A admin panel for strict CRUD operations such as adding/deleting snuses to the database, removing users posts and comments if vaiolation occurs. Right now all users can use CRUD wich is not safe!
  • Match favourite snus flavours and get recommendations on other snus brands that fits the users taste.
  • Rating on stores that sells snus and if it's not an online store, where they are located.
  • Ability for companys to market on the site.

Developers

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Project Link: https://github.com/chas-academy/u10-business-idea-snusmumriken-barn

Acknowledgements