This is a solution to the Link-sharing app challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- Create, read, update, delete links and see previews in the mobile mockup
- Receive validations if the links form is submitted without a URL or with the wrong URL pattern for the platform
- Drag and drop links to reorder them
- Add profile details like profile picture, first name, last name, and email
- Receive validations if the profile details form is saved with no first or last name
- Preview their devlinks profile and copy the link to their clipboard
- View the optimal layout for the interface depending on their device's screen size
- See hover and focus states for all interactive elements on the page
- Bonus: Save details to a database (build the project as a full-stack app)
- Bonus: Create an account and log in (add user authentication to the full-stack app)
- Solution URL: https://github.com/Chious/link-sharing-app-v2
- Live Site URL: https://link-sharing-app-v2.vercel.app
- Front-end
*main
*others
- dnd-kit - package to manage drag and drop
- @urql/next - package to manage graphql to nextjs in client side
- sweetalert2 - package to manage alert
- DB / Server
*main
- Next.JS - build with api router and server action
- TURSO - sqlite database
- drizzle-orm - package to manage sql to turso
- GraphQL - package to manage api
- Amazon S3 - package to save image in amazon
*others
- jsonwebtoken - package to manage jwt
- bycryptjs - package to manage password
- 【FE】 Create Pages and setting styles for front-end:
- setting
tailwind.config.ts
- create components (form/ dropdown/ etc)
- create pages (login/ register/ profile/ etc)
- build up drop and drag component with
dnd-kit
- 【BE】 Create GraphQL schema and mutation for backend:
- create
/api/graphql/schema.ts
- create
/api/graphql/mutation.ts
- create
/api/graphql/resolver.ts
-- connect graphql to Apollo Server - 【FE】setup client side
@urql/next
- 【BE】 Create schema for database and connect to TURSO with
dirzzle-orm
:Detail to the topic: https://orm.drizzle.team/learn/tutorials/drizzle-with-turso
- create
/api/db/index.ts
- create
/api/db/schema.ts
then run:
npm run db:gen
npm run db:push
-
【FE】 Finish register and login & CRUD for profile
the process is using
useQuery
anduseMutation
from@urql/next
-
【BE】 Upload image to S3 and save to database
the process is using
aws-sdk
to upload image to S3 Since form-data is restricted by GraphQL, create API route by nextjs instead.
- Setup User in S3, reference: https://conermurphy.com/blog/presigned-urls-nextjs-s3-upload
- CRUD with GraphQL in Server Side and Client Side
- Build up SQLite with
drizzle-orm
- Image Upload with
aws-sdk
- Presigned URL with
aws-sdk
- Drag and Drop with
dnd-kit