GithubHelp home page GithubHelp logo

michalusio / kunekune Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 105 KB

An informational site about KuneKunes

C# 25.91% Dockerfile 10.58% JavaScript 5.25% HTML 8.02% CSS 14.09% TypeScript 18.90% SCSS 17.25%

kunekune's People

Contributors

gyllenberg avatar

Watchers

Michał Isalski avatar  avatar

kunekune's Issues

3. Create the frontend solution

We want to create a React solution in the Frontend folder.

Specifically, the structure should look like:

Frontend

package.json
package-lock.json
...other files

To do so, first you have to install Node.js. You can google for it yourself, or use this link:

https://nodejs.org/en/download

After installing it, your console should have access to the npm tool. It's the package manager for managing creation of new JS projects, as well as managing the libraries used by those projects.

Using the command line, go to the Frontend folder and create a new project.
There are many ways of creating a JS project.
We will be using the Vite bundler with TypeScript (compiled using SWC) and React, so the command to create the project will look like this:
npm create vite@latest frontend -- --template react-swc-ts

And... if that doesn't error, it should create the whole project for us 😄

After creating the solution, do not forget to commit the changes and create a PR to the master branch.

2. Create the backend solution

We want to create a Visual Studio solution in the Backend folder.

Specifically, the structure should look like:

Backend

Backend.sln
...other files

To do so, first create and checkout a new branch (you can call it something like "backend-setup" or however you like).
Then, you want to open Visual Studio, select "Create a new project", and go through the whole process.
You should select:

  • "ASP.NET Core Web API" as the type of the project
  • the Backend folder as the root of the solution
  • .NET 8.0 as the framework
  • No authentication
  • No HTTPS support
  • Enable Docker (Linux as the OS)
  • Enable OpenAPI support
  • Top-level statements doesn't matter, we can go either
  • Use controllers

After creating the solution, do not forget to commit the changes and create a PR to the master branch.

1. Download the repository

  1. Install Git. It's the tool for managing code we create. It allows us to synchronize our changes with others, and make pull requests, so others can review our code before merging it into the main codebase
  2. Go to a folder where you have your projects and download this repository. Downloading can be done using a GUI of some kind, or you can just use the command line:
    git clone https://github.com/michalusio/KuneKune

Set a nice font for the project

We want our website to look nice, so we have to add a nice font to it.
The usual choice is something like Lato, although you can select a different font if something catches your eye.

As said on the Google page, you need to add a few HTML tags to the tag, which is located in Frontend/index.html

An explanation of the tags:

  • <link rel="preconnect" href=X> - this tag tells the browser to immediately create a connection to the given url. It increases the download performance, as when the browser gets down to parsing the line containing a file download, the connection is already established.
  • <link rel="stylesheet" href=X> - this tag tells the browser that it should load a file specified by a given url, and treat it as a stylesheet (i.e. a CSS file). That is the primary way of loading style files for your site.

Warning

Make sure that the branch you create is created from up-to-date master.

Note

To update a branch, first checkout it, then do git pull

Download Docker

Note

A "container" is akin to a virtual machine - programs running inside a container cannot affect things outside the container (if you don't allow them to). They think they are running on a different machine entirely.
It is a very convenient concept, as it allows us to e.g. run 10 different databases, backend and frontends without having to install any dependencies of them on your computer - you just download the "image", e.g. a snapshot of a container, and run it.

Docker is a tool for managing such containers.
You can download Docker Desktop (which is the GUI) here

Warning

If you're using a laptop from Columbus, be wary that your support will catch you and you will have to explain yourself, as using Docker Desktop for commercial use requires a paid license. If that's the case, you could use the command line after installing just the Docker Engine.

Overall, we will be using Docker to run the database locally, so we can store e.g. articles and other stuff in it, and serve it from the backend to the frontend.

4. Create a banner and a header

We should have at least 2 components there:

  1. header
  2. banner

Please use modular styles and keep in mind, that some elements will be reused (eg. button), so you can choose to either create a component for the button, or use globally available styles for it (the first option is better). The picture will be stored in assets, on React side.

Please use scss for styling, as it is much more convenient to use than plain css.
To enable it, install the sass package using npm install -D sass.
To create a modular style, the extension should be .module.scss.
Then you can import the style in the component by writing import styles from <filepath>;

image

Create the basic style variables for the project

We want our styles to have common colors and breakpoints available everywhere, so when we want to change some of them we won't have to go through the entire project.

To achieve that, create a _variables.scss file in the src/Styles folder (create it if needed), and put the variables there.

Note

Having the scss file start with _ means that this file is to be imported by other scss files, and not used separately

We want to have variables for each of the colors we will use in the design (your call!), as well as variables for the design breakpoints.

Common breakpoints:

  • xl: 1200px
  • lg: 992px
  • md: 768px
  • sm: 520px

Note

You can check out how to declare SCSS variables here

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.